import { ApiProperty, PartialType } from "@nestjs/swagger";
import { UserRole } from "../entities/user.entity";
import { FindLimitDto } from "src/dto/find-limit-dto";

export class UserInfoDto {
	@ApiProperty({ description: "用户id" })
	public id: string;
	@ApiProperty({ description: "用户名" })
	public account: string;
	@ApiProperty({ description: "昵称" })
	public nickname: string;
	@ApiProperty({ description: "头像" })
	public avatar: string;
	@ApiProperty({ description: "邮箱" })
	public email: string;
	@ApiProperty({ description: "开放ID" })
	public openid: string;
	@ApiProperty({ description: "用户角色" })
	public role: UserRole;
	@ApiProperty({ description: "创建时间" })
	public createTime: Date;
	@ApiProperty({ description: "修改时间" })
	public updateTime: Date;
}
export interface UsersRo<T> {
	list: T[];
	count: number;
}
export class QueryUserDto extends PartialType(FindLimitDto) {
	@ApiProperty({ description: "用户名" })
	readonly account?: string;
	@ApiProperty({ description: "昵称" })
	readonly nickname?: string;
	@ApiProperty({ description: "邮箱" })
	readonly email?: string;
	@ApiProperty({ description: "用户角色" })
	readonly role?: UserRole = UserRole.visitor;
}
